<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="viewport" id="viewport"
	content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="format-detection" content="telephone=no" />
<link href="./css/reset.css" rel="stylesheet" type="text/css">
<link href="./css/index.css" rel="stylesheet" type="text/css">
<link href="./css/discounts.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="js/jquery-1.8.3.min.js"></script>
</head>
<body>
	<div class="near-box">
		<!--头部开始-->
		<div class="header">
			<a href="javascript:history.back()" class="left"></a>
			<p class="headerText"></p>
		</div>
		
		<!--头部结束-->
		<div class="discounts-bigbox">
			<div class="discounts-banner1 mt-10">
				
			</div>
			<!-- <div class="discounts-banner1 mt-10"><img src="./images/coupon.jpg" alt=""></div> -->
			<div class="special-sale-box3 border-top">
				
			</div>

		</div>
		<!--bigbox结束 -->
		<!-- <div class="discounts-bottom">
      	 <div class="d-bottom-img1"><i>1</i></div>
      	 <span class="d-bottom-text1">￥10</span>
      	 <a href="" class="d-bottom-text2">去结算</a>
      </div> -->

	</div>
	<script type="text/javascript" src="js/scrolltopcontrol.js"></script>
	<script type="text/javascript">
		$(function(){
			
			$(".headerText").html(decodeURI(GetQueryString("name")));
			
			var cid="<%=request.getParameter("cId")%>";
			$.post("../../../tszs/txr/findShopDatails.do?cid="+cid,function(data){
			if(data.type==1){
				var html="";
				var img="";
				if(data.data[0].datas.length < 4 && data.data.length < 4){
					for (var i = 0; i < data.data.length; i++) {
						img="<img src='/file/"+data.data[i].pphoto+"'>";
						for (var c = 0; c < data.data[i].datas.length; c++) {
							html+="<ul class=\"goodUlBox\"><a href=\"javascript:findShopDatails('"+data.data[i].datas[c].sid+"')\">"+
							"<li class=\"goodsImg\"><img src='/file/"+data.data[i].datas[c].sphoto.split(",")[0]+"'><i class=\"d-box1-img2\"></i></li>"+
							"<li class=\"goodsName\">"+data.data[i].datas[c].sname+"</li>"+
							"<li class=\"goodsPrice\">￥"+data.data[i].datas[c].sprice+"</li>"+
							"<li class=\"goodsButton\">查看详情</li>"+
						"</a></ul>";		
						}
					}
				}
				else{
					for (var i = 0; i < data.data.length; i++) {
						img="<img src='/file/"+data.data[i].pphoto+"'>";
						for (var c = 0; c < data.data[i].datas.length; c++) {
							html+="<ul class=\"special-sale-box4 border-bottom\"><a href=\"javascript:findShopDatails('"+data.data[i].datas[c].sid+"')\">"+
							"<li class=\"special-sale-img1\"><img src='/file/"+data.data[i].datas[c].sphoto.split(",")[0]+"'><i class=\"d-box1-img2\"></i></li>"+
							"<li class=\"special-sale-tbox\">"+data.data[i].datas[c].sname+"</li>"+
							"<li class=\"special-sale-text2\">￥"+data.data[i].datas[c].sprice+"</li>"+
						"</a></ul>";		
						}
					}
				}
					
				$(".mt-10").html(img);
				$(".border-top").html(html);
				}else{
					$(".border-top").parent().css("text-align", "center");
					$(".border-top").html("<font color='#797778'>暂无更多数据！</font>");
				}

			},"json")
		})
		function findShopDatails(cid){
			 window.location.href="goods-details.jsp?cid="+cid;
		}
			
		function GetQueryString(name){
		     var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
		     var r = window.location.search.substr(1).match(reg);
		     if(r!=null)
		        return  decodeURI(r[2]);
		      return null;
		}
	</script>
</body>
